/*
	Name:
	Copyright:Take it at will
	Author:Rodney
	Date: 
	Description:
*/
#include<stdio.h>
#include<stdlib.h>
#include<memory.h>
int main()
{
	FILE *fp;
	long i,a[10]={0,1,2,3,4,5,6,7,8,9};
	if((fp = fopen("L_5.dat","wt")) == NULL)
	{
		puts("fail to open the file");
		exit(-1);
	}
	fwrite(a,sizeof(long),10,fp);
	fclose(fp);
	
	if((fp = fopen("L_5.dat","rt")) == NULL)
	{
		puts("fail to open the file");
		exit(-1);
	}
	memset(a,0,10*sizeof(long));
	fread(a,sizeof(long),10,fp);
	fclose(fp);
	
	for(i=0;i<10;i++)
		printf("%d ",a[i]);
}

